<template class="panel" style="zoom:200%">
  <!-- <el-input v-model="valuea"></el-input> -->
  <svg width="200" height="100">
    <g>
      <rect
        x="10"
        y="0"
        width="100"
        height="60"
        style="stroke-width: 1; stroke: rgb(0, 0, 0)"
        fill="red"
        id="11111"
      />
    </g>
    <!-- <rect
        x="50"
        y="20"
        width="50"
        height="20"
        style="stroke-width: 1; stroke: 'yellow'; pointer-events: none"
        fill="red"
        id="2222"
      /> -->
  </svg>
  <!-- <lalal></lalal> -->
</template>

<script>
import * as d3 from "d3";
export default {
  name: "lalal",
  data() {
    return {
      card: null,
      timer: null,
      valuea: "",
      keycode: null,
      figerJson: ["rect", "widget"],
    };
  },
  mounted() {
    this.runAllScript();
    window.addEventListener("keydown", this.v_keypress);
  },
  methods: {
    runAllScript() {
      this.timer = setInterval(function () {
        console.log("动态脚本");
      }, 1000);
    },
    v_keypress(event) {
      // 查看事件是否来自输入框
      const target = event.target;
      const isInput = target.tagName.toLowerCase() === "input";

      // 如果事件不来自输入框，执行相应的操作
      if (!isInput) {
        var keyCode = event.keyCode || event.which;
        console.log(keyCode);
        this.keycode = keyCode;
      }
    },
    showMeta() {
      if (figerJson[1] == "widget") {
      }
    },
  },
};
</script>

<style>
</style>